package com.leedsoft.service;

import com.leedsoft.common.Page;
import com.leedsoft.controller.dto.AidTaskDto;
import com.leedsoft.controller.vo.TaskPageVo;
import com.leedsoft.mapper.self.AidTaskSelfMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AidTaskServiceImpl implements AidTaskService {
    @Autowired
    private AidTaskSelfMapper aidTaskSelfMapper;
    @Override
    public Page<AidTaskDto> getTaskPage(TaskPageVo pageVo) {
        Page<AidTaskDto> page = new Page<>(pageVo);
        int count = aidTaskSelfMapper.getAidTaskListCount(pageVo);
        page.setCount(count);
        if (count>0){
            List<AidTaskDto> list = aidTaskSelfMapper.getAidTaskList(pageVo);
            page.setList(list);
        }
        return page;
    }
}
